$def with(form,title)

<div class="heading">
	<span>$title</span>
	<div class="tools">
		<input type="submit" class="btn btn-primary" value="发布" id="publish"/>
		<input type="submit" class="btn" value="保存为草稿" id="save-as-draft"/>
		<a href="/delete/$form.d.id" class="btn btn-danger delete">删除</a>
	</div>
</div>

$if not form.valid: 
	<div class="alert alert-error">请完善表单信息</div>
$:form.rendernote(form.note)

<div class="editarea">
    $for item in form.inputs:
        $if item.is_hidden():
            $:item.render()
        $elif item.name == 'content':
            <div class="form-item">
                <div class="wmd-panel">
                    <div id="wmd-button-bar"  class="wmd-button-bar"></div>
                    <textarea id="wmd-input" class="wmd-input" name="content">$:item.value</textarea>
                </div>
                <div id="wmd-preview" class="wmd-panel wmd-preview">$:item.value</div>
            </div>
        $else:
            <div class="form-item">
                $:item.render()
            </div>
</div>

<script type="text/javascript">
    Swallow.editor();
	Swallow.autoSize('.form-item textarea');
	Swallow.deleteComfirm('.delete');
	Swallow.saveActions();
</script>